﻿#ifndef _CUSER_H_
#define _CUSER_H_

#include "../basic/CMsg.h"
#include "CSparePart.h"

#ifdef __cplusplus
extern "C" {
#endif

#define USER_ST_NONE	0
#define USER_ST_READY	1
#define USER_ST_GAMING	2
#define USER_ST_PASUSE	3
#define USER_ST_END		4

typedef struct _cuser_ {
	//attribute
	unsigned int socket;
	int user_id;
	CSparePart* current;
	CSparePart* next;
	TOS_POINT next_base_in_pix;
	int st;

	//action
	int (*send_socket_msg)(struct _cuser_* thes, CMsg* msg);
} CUser;

int construct_user(CUser* thes, int user_id, unsigned int socket);

#ifdef __cplusplus
}
#endif
#endif
